<?php
/**
 * Coffee Framework

 * @category   CF
 * @package    CF
 * @author     그네 <Jung Sik, Park> <ccooffeee at hotmail dot com>
 * @copyright  Copyright (c) 2009 - 2010 Jung Sik, Park <ccooffeee at hotmail dot com>
 * @license    doc/LICENSE    Based New BSD License
 * @version    $Id: exception.php,v 0.2.0.1 2010/08/09 ccooffeee Exp $

 * LICENSE

 * 본 프로그램은 New BSD License 를 기본으로 하고 있지만 약간 다른 제약조건을 가지고 있습니다. 
 * 함께 제공된 license file 인  doc/LICENSE 를 꼭 확인하시길 바랍니다.

 * This Source is subject to the New BSD License with SOME CONSTRAINT that is boudled
 * with this package in the file doc/LICENSE 
 */


// CF Exception

class CF_exception extends Exception
{
	protected $exception = null;


	public function __construct ($msg = '', $code = 0, Exception $e = null) {
		parent::__construct($msg, (int)$code);
		$this->exception = $e;
	}

	public function getException() {
		return $this->exception;
	}

	public function __toString() {
		$e = $this->getException();
		if($e !== null)
			return $e->__toString()."\r\n".parent::__toString();

		return parent::__toString();
	}
}
?>
